#pragma once

#include "sa_sdk.h"
#include "CPlaceable.h"
#include "CCam.h"
#include "CQueuedMode.h"
#include "RenderWare.h"
#include "CEntity.h"
#include "CCamPathSplines.h"
#include "CMatrix.h"

#pragma pack(push, 1)
class PLUGIN_API CCamera : public CPlaceable
{
public:
	bool              m_bAboveGroundTrainNodesLoaded;
	bool              m_bBelowGroundTrainNodesLoaded;
	bool              m_bCamDirectlyBehind;
	bool              m_bCamDirectlyInFront;
	bool              m_bCameraJustRestored;
	bool              m_bcutsceneFinished;
	bool              m_bCullZoneChecksOn;
	bool              m_bFirstPersonBeingUsed;
	bool              m_bJustJumpedOutOf1stPersonBecauseOfTarget;
	bool              m_bIdleOn;
	bool              m_bInATunnelAndABigVehicle;
	bool              m_bInitialNodeFound;
	bool              m_bInitialNoNodeStaticsSet;
	bool              m_bIgnoreFadingStuffForMusic;
	bool              m_bPlayerIsInGarage;
	bool              m_bPlayerWasOnBike;
	bool              m_bJustCameOutOfGarage;
	bool              m_bJustInitalised;
	bool              m_bJust_Switched;
	bool              m_bLookingAtPlayer;
	bool              m_bLookingAtVector;
	bool              m_bMoveCamToAvoidGeom;
	bool              m_bObbeCinematicPedCamOn;
	bool              m_bObbeCinematicCarCamOn;
	bool              m_bRestoreByJumpCut;
	bool              m_bUseNearClipScript;
	bool              m_bStartInterScript;
	bool              m_bStartingSpline;
	bool              m_bTargetJustBeenOnTrain;
	bool              m_bTargetJustCameOffTrain;
	bool              m_bUseSpecialFovTrain;
	bool              m_bUseTransitionBeta;
	bool              m_bUseScriptZoomValuePed;
	bool              m_bUseScriptZoomValueCar;
	bool              m_bWaitForInterpolToFinish;
	bool              m_bItsOkToLookJustAtThePlayer;
	bool              m_bWantsToSwitchWidescreenOff;
	bool              m_bWideScreenOn;
	bool              m_b1rstPersonRunCloseToAWall;
	bool              m_bHeadBob;
	bool              m_bVehicleSuspenHigh;
	bool              m_bEnable1rstPersonCamCntrlsScript;
	bool              m_bAllow1rstPersonWeaponsCamera;
	bool              m_bCooperativeCamMode;
	bool              m_bAllowShootingWith2PlayersInCar;
	bool              m_bDisableFirstPersonInCar;
	unsigned __int16  m_wModeForTwoPlayersSeparateCars;
	unsigned __int16  m_wModeForTwoPlayersSameCarShootingAllowed;
	unsigned __int16  m_wModeForTwoPlayersSameCarShootingNotAllowed;
	unsigned __int16  m_wModeForTwoPlayersNotBothInCar;
	bool              m_bGarageFixedCamPositionSet;
	bool              m_bDoingSpecialInterPolation;
	bool              m_bScriptParametersSetForInterPol;
	bool              m_bFading;
	bool              m_bMusicFading;
	bool              m_bMusicFadedOut;
	bool              m_bFailedCullZoneTestPreviously;
	bool              m_bFadeTargetIsSplashScreen;
	bool              m_bWorldViewerBeingUsed;
	bool              m_bTransitionJUSTStarted;
	bool              m_bTransitionState;
	bool              m_nActiveCam;
	__int8 pad0[2];  
	unsigned __int32  m_dwCamShakeStart;
	unsigned __int32  m_dwFirstPersonCamLastInputTime;
	unsigned __int32  m_dwLongestTimeInMill;
	unsigned __int32  m_dwNumberOfTrainCamNodes;
	unsigned __int32  m_dwTimeLastChange;
	unsigned __int32  m_dwTimeWeLeftIdle_StillNoInput;
	unsigned __int32  m_dwTimeWeEnteredIdle;
	unsigned __int32  m_dwTimeTransitionStart;
	unsigned __int32  m_dwTransitionDuration;
	unsigned __int32  m_dwTransitionDurationTargetCoors;
	unsigned __int32  m_dwBlurBlue;
	unsigned __int32  m_dwBlurGreen;
	unsigned __int32  m_dwBlurRed;
	unsigned __int32  m_dwBlurType;
	unsigned __int32  m_dwWorkOutSpeedThisNumFrames;
	unsigned __int32  m_dwNumFramesSoFar;
	unsigned __int32  m_dwCurrentTrainCamNode;
	unsigned __int32  m_dwMotionBlur;
	unsigned __int32  m_dwMotionBlurAddAlpha;
	unsigned __int32  m_dwCheckCullZoneThisNumFrames;
	unsigned __int32  m_dwZoneCullFrameNumWereAt;
	unsigned __int32  m_dwWhoIsInControlOfTheCamera;
	unsigned __int32  m_dwCarZoom;
	float             m_fCarZoomBase;
	float             m_fCarZoomTotal;
	float             m_fCarZoomSmoothed;
	float             m_fCarZoomValueScript;
	float             m_fPedZoom;
	float             m_fPedZoomBase;
	float             m_fPedZoomTotal;
	float             m_fPedZoomSmoothed;
	float             m_fPedZoomValueScript;
	float             m_fCamFrontXNorm;
	float             m_fCamFrontYNorm;
	float             m_fDistanceToWater;
	float             m_fHeightOfNearestWater;
	float             m_fFOVDuringInter;
	float             m_fLODDistMultiplier;
	float             m_fGenerationDistMultiplier;
	float             m_fAlphaSpeedAtStartInter;
	float             m_fAlphaWhenInterPol;
	float             m_fAlphaDuringInterPol;
	float             m_fBetaDuringInterPol;
	float             m_fBetaSpeedAtStartInter;
	float             m_fBetaWhenInterPol;
	float             m_fFOVWhenInterPol;
	float             m_fFOVSpeedAtStartInter;
	float             m_fStartingBetaForInterPol;
	float             m_fStartingAlphaForInterPol;
	float             m_fPedOrientForBehindOrInFront;
	float             m_fCameraAverageSpeed;
	float             m_fCameraSpeedSoFar;
	float             m_fCamShakeForce;
	float             m_fFovForTrain;
	float             m_fFOV_Wide_Screen;
	float             m_fNearClipScript;
	float             m_fOldBetaDiff;
	float             m_fPositionAlongSpline;
	float             m_fScreenReductionPercentage;
	float             m_fScreenReductionSpeed;
	float             m_fAlphaForPlayerAnim1rstPerson;
	float             m_fOrientation;
	float             m_fPlayerExhaustion;
	float             m_fSoundDistUp;
	float             m_fSoundDistUpAsRead;
	float             m_fSoundDistUpAsReadOld;
	float             m_fAvoidTheGeometryProbsTimer;
	unsigned __int16  m_wAvoidTheGeometryProbsDirn;
	__int8 pad1[2];  
	float             m_fWideScreenReductionAmount;
	float             m_fStartingFOVForInterPol;
	CCam              m_aCams[3];
	class CGarage    *m_pToGarageWeAreIn;
	class CGarage    *m_pToGarageWeAreInForHackAvoidFirstPerson;
	CQueuedMode       m_PlayerMode;
	CQueuedMode       m_PlayerWeaponMode;
	CVector           m_vPreviousCameraPosition;
	CVector           m_vRealPreviousCameraPosition;
	CVector           m_vAimingTargetCoors;
	CVector           m_vFixedModeVector;
	CVector           m_vFixedModeSource;
	CVector           m_vFixedModeUpOffSet;
	CVector           m_vCutSceneOffset;
	CVector           m_vStartingSourceForInterPol;
	CVector           m_vStartingTargetForInterPol;
	CVector           m_vStartingUpForInterPol;
	CVector           m_vSourceSpeedAtStartInter;
	CVector           m_vTargetSpeedAtStartInter;
	CVector           m_vUpSpeedAtStartInter;
	CVector           m_vSourceWhenInterPol;
	CVector           m_vTargetWhenInterPol;
	CVector           m_vUpWhenInterPol;
	CVector           m_vClearGeometryVec;
	CVector           m_vGameCamPos;
	CVector           m_vSourceDuringInter;
	CVector           m_vTargetDuringInter;
	CVector           m_vUpDuringInter;
	CVector           m_vAttachedCamOffset;
	CVector           m_vAttachedCamLookAt;
	float             m_fAttachedCamAngle;
	RwCamera         *m_pRwCamera;
	class CEntity    *m_pTargetEntity;
	class CEntity    *m_pAttachedEntity;
	CCamPathSplines   m_aPathArray[4];
	bool              m_bMirrorActive;
	bool              m_bResetOldMatrix;
	__int8 pad2[2];
	CMatrix           m_mCameraMatrix;
	CMatrix           m_mCameraMatrixOld;
	CMatrix           m_mViewMatrix;
	CMatrix           m_mMatInverse;
	CMatrix           m_mMatMirrorInverse;
	CMatrix           m_mMatMirror;
	CVector           m_avFrustumNormals[4];
	CVector field_B54[4];
	CVector field_B84[4];
	float field_BB4[4];
	float field_BC4[4];
	CVector field_BD4;
	__int32 field_BE0;
	__int32 field_BE4;
	__int32 field_BE8;
	__int32 field_BEC;
	__int32 field_BF0;
	__int32 field_BF4;
	__int32 field_BF8;
	float             m_fFadeAlpha;
	__int32 field_C00;
	float             m_fFadeDuration;
	__int32 field_C08;
	__int32 field_C0C;
	__int32 field_C10;
	__int32 field_C14;
	__int32 field_C18;
	__int32 field_C1C;
	__int32 field_C20;
	__int32 field_C24;
	__int32 field_C28;
	__int32 field_C2C;
	unsigned __int16  m_wFadeInOutFlag;
	__int16 field_C32;
	__int32 field_C34;
	__int16 field_C38;
	__int16 field_C3A;
	__int16 field_C3C;
	__int16 field_C3E;
	unsigned __int32  m_dwFadeStartTime;
	__int32 field_C44;
	__int32 field_C48;
	__int32 field_C4C;
	__int32 field_C50;
	__int32 field_C54;
	__int32 field_C58;
	unsigned __int32  m_dwTransverseStartTime;
	unsigned __int32  m_dwTransverseEndTime;
	CVector           m_vTransverseEndPoint;
	CVector           m_vTransverseStartPoint;
	unsigned __int8   m_nTransverseMode;
	__int8 field_C7D;
	__int8 field_C7E;
	__int8 field_C7F;
	CVector field_C80;
	__int8 field_C8C;
	__int8 field_C8D;
	__int8 field_C8E;
	__int8 field_C8F;
	__int32 field_C90;
	unsigned __int32  m_dwStartJiggleTime;
	unsigned __int32  m_dwEndJiggleTime;
	__int32 field_C9C;
	__int32 field_CA0;
	unsigned __int32  m_dwStartZoomTime;
	unsigned __int32  m_dwEndZoomTime;
	float             m_fZoomInFactor;
	float             m_fZoomOutFactor;
	unsigned __int8   m_nZoomMode;
	__int8 field_CB5;
	__int8 field_CB6;
	__int8 field_CB7;
	__int32 field_CB8;
	__int32 field_CBC;
	__int32 field_CC0;
	CVector field_CC4;
	CVector field_CD0;
	__int8 field_CDC;
	__int8 field_CDD;
	__int8 field_CDE;
	__int8 field_CDF;
	CVector field_CE0;
	__int8 field_CEC;
	bool              m_bBlockZoom;
	__int8 field_CEE;
	__int8 field_CEF;
	__int8 field_CF0;
	__int8 field_CF1;
	__int8 field_CF2;
	__int8 field_CF3;
	__int8 field_CF4[80];
	__int32 field_D44;
	__int32 field_D48;
	__int32 field_D4C;
	__int32 field_D50;
	__int32 field_D54;
	__int32 field_D58;
	__int32 field_D5C;
	__int32 field_D60;
	__int32 field_D64;
	__int32 field_D68;
	__int32 field_D6C;
	__int32 field_D70;
	__int32 field_D74;
};
#pragma pack(pop)

extern PLUGIN_API CCamera *TheCamera;